I tried with recording lengths from 5 seconds to 2 minutes. I am getting error codes of type-2 and tyoe-7 (only :().
Use a length of 20-30 seconds, which it's been tuned for. You can try longer than that but you probably won't see much benefit.
Sometimes it returns code type - 6 (Single match) or type - 7.
These return codes don't make sense within the context of your results, i.e., 6 means a positive match was identified from several potential candidate matches, and 7 means no match was able to be identified from several potential candidate matches. Did you ingest the same track multiple times? Can you try querying again?
Finally, the Echoprint Google Group is probably a better place to try to resolve these sorts of issues, i.e., if you're setting up your own server. This forum is fine, but more suited to questions specifically about the song/identify API hosted by The Echo Nest.
Andrew