Allow case-insensitive API queries

Added tests and implementation