Added new error code for invalid requests
Updated some lookup logic