Better and More efficient DB checks with more scenarios. Now returns an array including information about request, so send to javascript.